import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-08-14
 * Time: 18:41
 */
public class Test {
    public static int sqrt (int x) {
        // write code here
        long left = 1;
        long right = x;
        long mid = (left + right) / 2;
        while(left != mid){
            if(mid * mid == x){
                break;
            }else if(mid * mid > x){
                right = mid;
            }else{
                left = mid;
            }
            mid = (left + right) / 2;
        }
        return (int)mid;
    }
    public static void main(String[] args) {
        int x = 2143195649;
        int ret = sqrt(x);
        System.out.println(ret);
    }
    public static boolean judge (String str) {
    // write code here
        int left = 0;
        int right = str.length() -1;
        char[] ch = str.toCharArray();
        while (left < right){
            if(ch[left] != ch[right]){
                return false;
            }else{
                left++;
                right--;
            }

        }
        return true;
}

    public static void main4(String[] args) {
        String str = "aabcbaaa";
        boolean ret = judge(str);
        System.out.println(ret);
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()){
            String str = scanner.nextLine();
            int len = str.length();
            char[] arry = str.toCharArray();
            Arrays.sort(arry);
            StringBuffer stringBuffer = new StringBuffer();
            for (int i = 0; i < len; i++) {
                stringBuffer.append(arry[i]);
            }
            System.out.println(stringBuffer);
        }
    }
    public static void printArray(int[] arry,int len){
        if(len > 0){
            System.out.print(arry[len-1] + " ");
            len--;
            printArray(arry,len);
        }
    }
    public static void main1(String[] args) {
        int[] arry = {1,3,5,7,6};
        int len = arry.length;
        printArray(arry,len);
    }
}
